package tpo.wmb.provider.dao;


import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import pojo.BuyReturn;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@Repository
public interface BuyReturnMapper {

    /**
     * 分页条件查询退货单
     */
    List<BuyReturn> selectBuyReturnList(Map<String,Object> map);


    /**
     * 查看退货单详情
     */
    @Select("select * from buy_return where id = #{id}")
    BuyReturn selectBuyReturn(Integer id);


    /**
     * 修改退货单
     */
    Integer updateBuyReturn( BuyReturn buyReturn);


    /**
     * 新增退货单
     */
    Integer insertBuyReturn( BuyReturn buyReturn);


    /**
     * 逻辑删除退货单
     */
    @Update("update buy_return set isDelete=0 where id = #{id}")
    Integer deleteBuyReturn( Integer id);


    /**
     * 根据退货单id显示退货单页面
     * @param id
     * @return
     */
    Map<String,Object> seeUpdateBuyReturn(Integer id);

    /**
     * 修改退货单状态
     * @param orderSta 退货单状态
     * @param receSta 付款状态
     * @param id id
     * @return
     */
    Integer updateBuyReturnState( Integer orderSta, Integer receSta, Integer id);

    /**
     * 查看退货单详情
     * @param code
     * @return
     */
    @Select("select * from buy_return where code = #{code}")
    BuyReturn selectBuyReturn2( String code);



}